home *** CD-ROM | disk | FTP | other *** search
/ Aminet 33 / Aminet 33 - October 1999.iso / Aminet / dev / src / WBBump_src.lha / WBBump_src / Plugins / blur_supp.asm next >
Encoding:
Assembly Source File  |  1999-06-30  |  1.7 KB  |  88 lines

  1. ******************
  2. * blur_sub.asm *
  3. ******************
  4.  
  5.  
  6.  
  7. ***    WBBump - Bumpmapping on the Workbench!
  8.  
  9. ***    Copyright (C) 1999  Thomas Jensen - dm98411@edb.tietgen.dk
  10.  
  11. ***    This program is free software; you can redistribute it and/or modify
  12. ***    it under the terms of the GNU General Public License as published by
  13. ***    the Free Software Foundation; either version 2 of the License, or
  14. ***    (at your option) any later version.
  15.  
  16. ***    This program is distributed in the hope that it will be useful,
  17. ***    but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. ***    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  19. ***    GNU General Public License for more details.
  20.  
  21. ***    You should have received a copy of the GNU General Public License
  22. ***    along with this program; if not, write to the Free Software Foundation,
  23. ***    Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
  24.  
  25.  
  26.     xdef    blur_buffer_iiii
  27.  
  28.  
  29. ***    blur_buffer(inbuf, outbuf, width, height)
  30.  
  31. *** 16 inbuf    :    ucharptr
  32. *** 12 outbuf    :    ucharptr
  33. ***  8 width    :    ulong
  34. ***  4 height    :    ulong
  35.  
  36.  
  37. blur_buffer_iiii:
  38.     move.l    16(sp),a0    *    input
  39.     move.l    12(sp),a3    *    output
  40.     move.l     8(sp),d0    *    width
  41.     move.l     4(sp),d1    *    height
  42.  
  43.     add.l    d0,a0        *    one line down
  44.     add.l    #1,a0        *    one line + 1 pixel to the right (boundry)
  45.     move.l    a0,a1
  46.     sub.l    d0,a1        *    one line up
  47.     move.l    a0,a2
  48.     add.l    d0,a2        *    one line down
  49.  
  50.  
  51.     sub.l    #2,d0        *    width-2
  52.     sub.l    #2,d1        *    height-2
  53.  
  54.  
  55. .ly
  56.     move.l    d0,d2
  57. .lx
  58.  
  59.     clr.w    d3
  60.     clr.w    d4
  61.  
  62.     move.b    (a1)+,d3
  63.     move.b    (a2)+,d4
  64.     add.w    d4,d3
  65.     move.b    -1(a0),d4
  66.     add.w    d4,d3
  67.     move.b    1(a0),d4
  68.     add.w    d4,d3
  69.     move.b    (a0)+,d4
  70.     lsl.w    #2,d4
  71.     add.w    d4,d3
  72.     lsr.w    #3,d3
  73.  
  74.     move.b    d3,(a3)+
  75.  
  76.     subq.l    #1,d2
  77.     bne    .lx
  78.  
  79.     add.l    #2,a0
  80.     add.l    #2,a1
  81.     add.l    #2,a2
  82.     add.l    #2,a3
  83.  
  84.     subq.l    #1,d1
  85.     bne    .ly
  86.  
  87.     rts
  88.